package com.lzw.controller;

import com.lzw.entity.User;
import com.lzw.service.BaseService;
import com.lzw.utils.R;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class BaseController {

    private final BaseService baseService;

    @PostMapping("public/login")
    public R login(@RequestBody User user){
        return baseService.login(user);
    }

    @PostMapping("public/register")
    public R register(@RequestBody User user){
        return baseService.register(user);
    }

    @PostMapping("/logout")
    public R logout(){
        return baseService.logout();
    }


}
